/*
   g++ -o PuckSupplyTest.exe PuckSupplyTest.cpp PuckSupply.cpp \
      -lgtest -lgtest_main -lpthread
*/

#include <gtest/gtest.h>
#include "PuckSupply.h"

TEST(PuckSupplyTest, CheckConstructor)
{
   PuckSupply pucks;
   EXPECT_EQ(3, pucks.size());
}

TEST(PuckSupplyTest, CheckThatSizeCanBeCallManyTimes)
{
   PuckSupply pucks;
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
   EXPECT_EQ(3, pucks.size());
}

TEST(PuckSupplyTest, CheckThatGetCanBeCalledThreeTimes)
{
   PuckSupply pucks;
   EXPECT_EQ(3, pucks.size());
   EXPECT_TRUE(NULL != pucks.get());
   EXPECT_EQ(2, pucks.size());
   EXPECT_TRUE(NULL != pucks.get());
   EXPECT_EQ(1, pucks.size());
   EXPECT_TRUE(NULL != pucks.get());
   EXPECT_EQ(0, pucks.size());
   EXPECT_TRUE(NULL == pucks.get());
}
